﻿/******************************************************************************
* File description: FBMaintenance.qml
* Function: 放靶维护校正页面
* Current Version: 1.1
* Author: 陈乃瑞
* Date: 2025-07-01
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Layouts 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.Controls 2.12
import QtMultimedia 5.14

import "../animation/shiftingAnimation"

Rectangle{
    id: root
    //    title: "维护校正"
    width: parent.width
    height:  parent.height
    color: "white"
    radius: 12
    //    minimumWidth: 1430*dp
    //    minimumHeight: 860*dp
    //    maximumWidth: 1430*dp
    //    maximumHeight: 860*dp
    property int flagwh: 1
    property int flagcs: 1
    property int flagwc: 1
    property int gdwh: 1
    property int gdcs: 1
    property int gdwc: 1
    property int zbqgnum: 0
    property int xznum: 1
    property int xpnum: 1
    property int zznum: 1
    property int hjnum: 1
    property int kgnum: 1
    property int fycb: 0
    property int alldcf: 0
    onVisibleChanged: {

    }

    Connections{  // qmlre
        target: CSignal
        onRefCommunicationLog:{
            logtab.setData(CMaintenance.getLog())
        }
    }
    Connections{  // qmlre
        target: CMaintenance
        onDellog:{
            logtab.setData(CMaintenance.getLog())
        }
    }
    Connections{
        target: CSignal
        //        onSendTargetAirPumpPressure:{
        //            qbylz.setText(airValue)
        //        }
        onFbGetAir:{
            kgvalue.setText(airValue)
        }

        onSendResetMsg:{
            if(status==="0"){
                maintenanceToast.show("复位完成",0)
            }
            else if(status==="1"){
                maintenanceToast.show("正在进行复位,请耐心等待",2)
            }
        }
        onTargetGasPumpValue:{
            fbqdyl.setText(value)
        }
        onSendTargetDelivery:{
            qfbs.setText(step)
        }
        onGetSuctionCupPressure:{
            xpqyyl.setText(suctioncupValue)
        }
        onGetMotorPosition:{
            kgbs.setText(motorPos)
        }
        onGetScrewCapInfo:{
            ggzs.setText(speed)
            ggbs.setText(step)
        }
        onTargetPadPumpValue:{
            zbxpylss.setText(yl)
        }
        onZbxpGetAir:{
            zbxpyl1.setText(airValue1)
            zbxpyl2.setText(airValue2)
        }
        onZbZZ:{
            zbzzsd.setText(sd)
            zbzzbs.setText(wz)
        }
        onZbXZ:{
            zbxzsd.setText(sd)
            zbxzbs.setText(wz)
        }
        onZbKG:{
            zbkgsd.setText(sd)
            zbkgbs.setText(wz)
        }
        onZbHX:{
            zbhxsd.setText(sd)
            zbhxbs.setText(wz)
        }
        onZbXPDJ:{
            zbxpdjsd.setText(sd)
            zbxpdjbs.setText(wz)
        }

    }


    CustomPopupBoxWarning{
        id: qdhfcs
        box_text: "确认恢复初始状态吗?"
        onAccepted: {

        }
    }
    CustomPopupBoxWarning{
        id: qdfw
        box_text: "确认复位吗?"
        onAccepted: {
            CMaintenance.reset("0","8","")
        }
    }
    CustomPopupBoxWarning{
        id: qdxf
        box_text: "确认数据下发吗?"
        onAccepted: {
            CMaintenance.saveData(1)
        }
    }
    Rectangle{
        x:10*dp
        y:10*dp
        width: parent.width-2*x
        height: parent.height-2*x
        Rectangle{
            x:0*dp
            y:0*dp
            width: parent.width*0.7
            height: parent.height
            ScrollView{
                y:2*dp
                id: scrollView
                width: parent.width
                height: parent.height-4*dp
                clip: true
                Column{
                    id: columnLayout
                    x:2*dp
                    y:0*dp
                    width: parent.width-4*dp
                    height: parent.height-4*dp
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("空压机气压维护")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:kgtype
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["开阀门","关阀门","回靶关挡板"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                            CustomInputText{
                                id:kgvalue
                                x:330*dp
                                y:2*dp
                                titleWidth: 100*dp
                                editWidth: 100*dp
                                title: "压力值(MPa):"
                                prompt:"10-10000"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomComboButtonwh{
                                anchors.centerIn: parent
                                model: ["写入","读取"]
                                onTextClicked: {
                                    if(text==="写入"){
                                        CMaintenance.setAir(kgtype.text,kgvalue.getText())
                                    }else{
                                        CMaintenance.getAir(kgtype.text)
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("吸盘气压维护")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomInputText{
                                id:zbxpyl1
                                x:5*dp
                                y:2*dp
                                titleWidth: 160*dp
                                editWidth: 100*dp
                                title: "吸盘1压力值(MPa):"
                                prompt:"10-10000"
                            }
                            CustomInputText{
                                id:zbxpyl2
                                x:275*dp
                                y:2*dp
                                titleWidth: 160*dp
                                editWidth: 100*dp
                                title: "吸盘2压力值(MPa):"
                                prompt:"10-10000"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomComboButtonwh{
                                anchors.centerIn: parent
                                model: ["写入","读取"]
                                onTextClicked: {
                                    if(text==="写入"){
                                        CMaintenance.setXpAir(zbxpyl1.getText(),zbxpyl2.getText())
                                    }else{
                                        CMaintenance.getXpAir()
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("蠕动泵速度校正")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 86 * dp
                            CustomRadioGroup{
                                id:rddz
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["吸液","打液","停止"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                            CustomInputText{
                                id:zbrdsd
                                x:250*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 90*dp
                                title: "速度(RPM):"
                                prompt:"10-10000"
                            }
                            CustomInputText{
                                id:zbrdsj
                                x:445*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 90*dp
                                title: "延时停止(s):"
                                prompt:"10-10000"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    CMaintenance.runZbRD(rddz.text,zbrdsd.getText(),zbrdsj.getText())
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("挡板运动")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:dbdz
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["遮挡","打开"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    if(dbdz.text==="遮挡"){
                                        CMaintenance.maintenanceAction("挡板运动遮挡")
                                        CAnimationShifting.pushBaffle()
                                    }else{
                                        CMaintenance.maintenanceAction("挡板运动打开")
                                        CAnimationShifting.pullBaffle()
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("旋盖夹爪")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:xgjzdz
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["夹紧","松开"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    if(xgjzdz.text==="夹紧"){
                                        CMaintenance.maintenanceAction("旋盖夹爪夹紧")
                                    }else{
                                        CMaintenance.maintenanceAction("旋盖夹爪松开")
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("梭体夹爪")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:stjzdz
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["夹紧","松开"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    if(stjzdz.text==="夹紧"){
                                        CMaintenance.maintenanceAction("梭体夹爪夹紧")
                                        CAnimationShifting.openClamp()
                                    }else{
                                        CMaintenance.maintenanceAction("梭体夹爪松开")
                                        CAnimationShifting.closeClamp()
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("吸盘")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:xpdz1
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["开启","关闭"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                            CustomRadioGroup{
                                id:xp1
                                x:175*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["吸盘1","吸盘2"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    CMaintenance.maintenanceAction(xp1.text+xpdz1.text)
                                    if(xpdz1.text==="开启"){
                                        CAnimationShifting.zQiGangUp()
                                    }else{
                                        CAnimationShifting.zQiGangDown()
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("Z轴气缸")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:zzdz
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["上升","下降"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    if(zzdz.text==="上升"){
                                        CMaintenance.maintenanceAction("Z轴气缸上升")
                                        CAnimationShifting.zQiGangUp()
                                    }else{
                                        CMaintenance.maintenanceAction("Z轴气缸下降")
                                        CAnimationShifting.zQiGangDown()
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("梭体盖")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:gdz
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["开盖","关盖"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    CMaintenance.maintenanceAction(gdz.text)
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("取放靶")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:qfbcs
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["取靶","放靶","探测"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                            CustomRadioGroup{
                                id:qfbxp
                                x:245*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["吸盘1","吸盘2"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                            CustomComboBox{
                                id:qfbwz
                                x:430*dp
                                y:2*dp
                                title: "位置"
                                model: ["靶材罐","溶靶瓶","检测瓶","活度检测位","开盖检测"]
                                titleWidth: 60*dp
                                editWidth: 110*dp
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    CMaintenance.runQFB(qfbcs.text,qfbwz.getText(),qfbxp.text)
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("活检")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:hjdz
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["放检位置","活检位置"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    CMaintenance.HJWZ(hjdz.text)
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("加热")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomInputText{
                                id:jrwd
                                x:5*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 90*dp
                                title: "温度(℃):"
                                prompt:"25-100"
                            }
                            CustomInputText{
                                id:jrsj
                                x:195*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 90*dp
                                title: "时间(s):"
                                prompt:"10-10000"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    CMaintenance.zbjr(jrwd.getText(),jrsj.getText())
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("转靶气缸")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomButton{
                                x:5*dp
                                y:2*dp
                                width: 100*dp
                                title: "全开"
                                button_color : zbqgnum===0?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    zbqgnum=0
                                }
                            }
                            CustomButton{
                                x:115*dp
                                y:2*dp
                                width: 100*dp
                                title: "全关"
                                button_color : zbqgnum===1?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    zbqgnum=1
                                }
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    CMaintenance.ZBQG(zbqgnum===0?"全开":"全关")
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 44*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            Text {
                                text: qsTr("激光加热指示灯")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 44 * dp
                            CustomRadioGroup{
                                id:zsddz
                                x:5*dp
                                y:2*dp
                                spacing: 0*dp
                                checkedIndex: 0
                                width: 200*dp
                                height: 40*dp
                                model: ["开启","关闭"]
                                radio_background_color: "#E7F1FF"
                                radio_background_color_select: "#E7F1FF"
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 44 * dp
                            CustomButton{
                                anchors.centerIn: parent
                                title: "执行"
                                button_color: "#E7F1FF"
                                button_border: "#1677FF"
                                onReleased: {
                                    CMaintenance.ZSD(zsddz.text)
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 170*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 170 * dp
                            Text {
                                text: qsTr("X轴电机位置校正")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 170 * dp
                            CustomInputText{
                                id:zbxzsd
                                x:5*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 90*dp
                                title: "速度:"
                            }
                            CustomInputTextSpin{
                                id:zbxzbs
                                x:190*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 120*dp
                                title: "步数:"
                                spinIncrement:5
                            }
                            CustomButton{
                                x:5*dp
                                y:44*dp
                                width: 150*dp
                                title: "吸盘1靶材罐位置"
                                button_color : xznum===1?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xznum=1
                                }
                            }
                            CustomButton{
                                x:165*dp
                                y:44*dp
                                width: 150*dp
                                title: "吸盘1放检位置"
                                button_color : xznum===2?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xznum=2
                                }
                            }
                            CustomButton{
                                x:325*dp
                                y:44*dp
                                width: 150*dp
                                title: "吸盘1溶靶瓶(放靶)"
                                button_color : xznum===3?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xznum=3
                                }
                            }
                            CustomButton{
                                x:485*dp
                                y:44*dp
                                width: 150*dp
                                title: "吸盘1溶靶瓶(纯化)"
                                button_color : xznum===4?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xznum=4
                                }
                            }
                            CustomButton{
                                x:5*dp
                                y:86*dp
                                width: 150*dp
                                title: "吸盘2靶材罐位置"
                                button_color : xznum===5?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xznum=5
                                }
                            }
                            CustomButton{
                                x:165*dp
                                y:86*dp
                                width: 150*dp
                                title: "吸盘2放检位置"
                                button_color : xznum===6?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xznum=6
                                }
                            }
                            CustomButton{
                                x:325*dp
                                y:86*dp
                                width: 150*dp
                                title: "吸盘2溶靶瓶(放靶)"
                                button_color : xznum===7?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xznum=7
                                }
                            }
                            CustomButton{
                                x:485*dp
                                y:86*dp
                                width: 150*dp
                                title: "吸盘2溶靶瓶(纯化)"
                                button_color : xznum===8?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xznum=8
                                }
                            }
                            CustomButton{
                                x:5*dp
                                y:128*dp
                                width: 150*dp
                                title: "开关盖位置"
                                button_color : xznum===9?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xznum=9
                                }
                            }
                            CustomButton{
                                x:165*dp
                                y:128*dp
                                width: 150*dp
                                title: "开关盖检测位置"
                                button_color : xznum===10?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xznum=10
                                }
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 170 * dp
                            CustomComboButtonwh{
                                anchors.centerIn: parent
                                model: ["写入","读取"]
                                onTextClicked: {
                                    if(text==="写入"){
                                        CMaintenance.setZbXZ(xznum,zbxzsd.getText(),zbxzbs.getText())
                                    }else if(text==="读取"){
                                        CMaintenance.getZbXZ(xznum)
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 128*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 128 * dp
                            Text {
                                text: qsTr("吸盘电机位置校正")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 128 * dp
                            CustomInputText{
                                id:zbxpdjsd
                                x:5*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 90*dp
                                title: "速度:"
                            }
                            CustomInputTextSpin{
                                id:zbxpdjbs
                                x:190*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 120*dp
                                title: "步数:"
                                spinIncrement:5
                            }
                            CustomButton{
                                x:5*dp
                                y:44*dp
                                width: 150*dp
                                title: "吸盘1靶材罐位置"
                                button_color : xpnum===1?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xpnum=1
                                }
                            }
                            CustomButton{
                                x:168*dp
                                y:44*dp
                                width: 150*dp
                                title: "吸盘1放检位置"
                                button_color : xpnum===2?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xpnum=2
                                }
                            }
                            CustomButton{
                                x:325*dp
                                y:44*dp
                                width: 150*dp
                                title: "吸盘1溶靶瓶(放靶)"
                                button_color : xpnum===3?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xpnum=3
                                }
                            }
                            CustomButton{
                                x:485*dp
                                y:44*dp
                                width: 150*dp
                                title: "吸盘1溶靶瓶(纯化)"
                                button_color : xpnum===4?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xpnum=4
                                }
                            }
                            CustomButton{
                                x:5*dp
                                y:86*dp
                                width: 150*dp
                                title: "吸盘2靶材罐位置"
                                button_color : xpnum===5?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xpnum=5
                                }
                            }
                            CustomButton{
                                x:165*dp
                                y:86*dp
                                width: 150*dp
                                title: "吸盘2放检位置"
                                button_color : xpnum===6?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xpnum=6
                                }
                            }
                            CustomButton{
                                x:325*dp
                                y:86*dp
                                width: 150*dp
                                title: "吸盘2溶靶瓶(放靶)"
                                button_color : xpnum===7?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xpnum=7
                                }
                            }
                            CustomButton{
                                x:485*dp
                                y:86*dp
                                width: 150*dp
                                title: "吸盘2溶靶瓶(纯化)"
                                button_color : xpnum===8?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    xpnum=8
                                }
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 128 * dp
                            CustomComboButtonwh{
                                anchors.centerIn: parent
                                model: ["写入","读取"]
                                onTextClicked: {
                                    if(text==="写入"){
                                        CMaintenance.setZbXPDJ(xpnum,zbxpdjsd.getText(),zbxpdjbs.getText())
                                    }else if(text==="读取"){
                                        CMaintenance.getZbXPDJ(xpnum)
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 128*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 128 * dp
                            Text {
                                text: qsTr("Z轴电机位置校正")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 128 * dp
                            CustomInputText{
                                id:zbzzsd
                                x:5*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 90*dp
                                title: "速度:"
                            }
                            CustomInputTextSpin{
                                id:zbzzbs
                                x:190*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 120*dp
                                title: "步数:"
                                spinIncrement:5
                            }
                            CustomButton{
                                x:5*dp
                                y:44*dp
                                width: 150*dp
                                title: "靶材罐位置取靶"
                                button_color : zznum===1?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    zznum=1
                                }
                            }
                            CustomButton{
                                x:165*dp
                                y:44*dp
                                width: 150*dp
                                title: "靶材罐位置放靶"
                                button_color : zznum===2?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    zznum=2
                                }
                            }
                            CustomButton{
                                x:325*dp
                                y:44*dp
                                width: 150*dp
                                title: "放检位置取靶"
                                button_color : zznum===3?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    zznum=3
                                }
                            }
                            CustomButton{
                                x:485*dp
                                y:44*dp
                                width: 150*dp
                                title: "放检位置放靶"
                                button_color : zznum===4?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    zznum=4
                                }
                            }
                            CustomButton{
                                x:5*dp
                                y:86*dp
                                width: 150*dp
                                title: "溶靶瓶(1)放靶"
                                button_color : zznum===5?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    zznum=5
                                }
                            }
                            CustomButton{
                                x:165*dp
                                y:86*dp
                                width: 150*dp
                                title: "溶靶瓶(2)放靶"
                                button_color : zznum===6?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    zznum=6
                                }
                            }
                            CustomButton{
                                x:325*dp
                                y:86*dp
                                width: 150*dp
                                title: "开关盖检测位置"
                                button_color : zznum===7?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    zznum=7
                                }
                            }

                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 128 * dp
                            CustomComboButtonwh{
                                anchors.centerIn: parent
                                model: ["写入","读取"]
                                onTextClicked: {
                                    if(text==="写入"){
                                        CMaintenance.setZbZZ(zznum,zbzzsd.getText(),zbzzbs.getText())
                                    }else if(text==="读取"){
                                        CMaintenance.getZbZZ(zznum)
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 86*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 86 * dp
                            Text {
                                text: qsTr("活检电机位置校正")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 86 * dp
                            CustomInputText{
                                id:zbhxsd
                                x:5*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 90*dp
                                title: "速度:"
                            }
                            CustomInputTextSpin{
                                id:zbhxbs
                                x:190*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 120*dp
                                title: "步数:"
                                spinIncrement:5
                            }
                            CustomButton{
                                x:5*dp
                                y:44*dp
                                width: 150*dp
                                title: "放检位置"
                                button_color : hjnum===1?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    hjnum=1
                                }
                            }
                            CustomButton{
                                x:165*dp
                                y:44*dp
                                width: 150*dp
                                title: "检测位置"
                                button_color : hjnum===2?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    hjnum=2
                                }
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 86 * dp
                            CustomComboButtonwh{
                                anchors.centerIn: parent
                                model: ["写入","读取"]
                                onTextClicked: {
                                    if(text==="写入"){
                                        CMaintenance.setZbHX(hjnum,zbhxsd.getText(),zbhxbs.getText())
                                    }else if(text==="读取"){
                                        CMaintenance.getZbHX(hjnum)
                                    }
                                }
                            }
                        }
                    }
                    Row{
                        x:0*dp
                        width: parent.width
                        height: 86*dp
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 86 * dp
                            Text {
                                text: qsTr("开盖电机校正")
                                anchors.verticalCenter: parent.verticalCenter
                                anchors.right: parent.right
                                anchors.rightMargin: 5 * dp
                                horizontalAlignment: Text.AlignRight
                                font.pixelSize: config.fontsize
                                width: contentWidth
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.70
                            height: 86 * dp
                            CustomInputText{
                                id:zbkgsd
                                x:5*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 90*dp
                                title: "速度:"
                            }
                            CustomInputTextSpin{
                                id:zbkgbs
                                x:190*dp
                                y:2*dp
                                titleWidth: 90*dp
                                editWidth: 120*dp
                                title: "步数:"
                                spinIncrement:5
                            }
                            CustomButton{
                                x:5*dp
                                y:44*dp
                                width: 150*dp
                                title: "开盖(逆时针)"
                                button_color : kgnum===1?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    kgnum=1
                                }
                            }
                            CustomButton{
                                x:165*dp
                                y:44*dp
                                width: 150*dp
                                title: "关盖(逆时针)"
                                button_color : kgnum===2?"#E7F1FF":"white"
                                text_color   : "#333333"
                                button_border : "#CCCCCC"
                                button_border_hover : "#1677FF"
                                text_color_hover : "#1677FF"
                                button_color_hover : "#ecf5ff"
                                onReleased: {
                                    kgnum=2
                                }
                            }
                        }
                        Rectangle {
                            y: 0 * dp
                            border.width: 1
                            border.color: "#B8B7B5"
                            width: scrollView.width * 0.15
                            height: 86 * dp
                            CustomComboButtonwh{
                                anchors.centerIn: parent
                                model: ["写入","读取"]
                                onTextClicked: {
                                    if(text==="写入"){
                                        CMaintenance.setZbKG(kgnum,zbkgsd.getText(),zbkgbs.getText())
                                    }else if(text==="读取"){
                                        CMaintenance.getZbKG(kgnum)
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        Rectangle{
            x:parent.width*0.7+1*dp
            y:2*dp
            width: parent.width*0.3
            height: parent.height
            border.width: 1
            border.color: "#B8B7B5"
            Rectangle{
                x:0*dp
                y:0*dp
                width: parent.width
                height: parent.height*0.2
                border.width: 1
                border.color: "#B8B7B5"
                CustomButton{
                    x:5*dp
                    y:20*dp
                    width: (parent.width-20*dp)/3
                    button_color: "#F2F2F2"
                    button_icon: "qrc:/picture/maintain/fw.png"
                    title: "复位"
                    onReleased: {
                        qdfw.show()
                    }
                }
                CustomButton{
                    x:10*dp+(parent.width-20*dp)/3
                    y:20*dp
                    width: (parent.width-20*dp)/3
                    button_color: "#F2F2F2"
                    button_icon: "qrc:/picture/maintain/xf.png"
                    title: "下发"
                    onReleased: {
                        qdxf.show()
                    }
                }
                CustomButton{
                    x:15*dp+(parent.width-20*dp)/3*2
                    y:20*dp
                    width: (parent.width-20*dp)/3
                    button_color: "#F2F2F2"
                    button_icon: "qrc:/picture/maintain/zt.png"
                    title: "状态获取"
                    onReleased: {
                        statepop.show()
                    }
                }
                CustomButton{
                    x:5*dp
                    y:80*dp
                    width: (parent.width-20*dp)/3
                    button_color: alldcf===0?"#F2F2F2":"#67C23A"
                    button_icon: "qrc:/picture/maintain/dcf.png"
                    title: "所有电磁阀"
                    onReleased: {
                        if(alldcf===0){
                            CMaintenance.dbrundcf("打开")
                            alldcf=1
                        }else{
                            CMaintenance.dbrundcf("关闭")
                            alldcf=0
                        }
                    }
                }
                CustomButton{
                    x:10*dp+(parent.width-20*dp)/3
                    y:80*dp
                    width: (parent.width-20*dp)/3
                    button_color: "#F2F2F2"
                    button_icon: "qrc:/picture/maintain/txrz.png"
                    title: "通信日志"
                    onReleased: {
                        logwindow.show()
                    }
                }
                CustomButton{
                    x:15*dp+(parent.width-20*dp)/3*2
                    y:80*dp
                    width: (parent.width-20*dp)/3
                    button_color:fycb===0?"#F2F2F2":"#67C23A"
                    button_icon: "qrc:/picture/maintain/fycb.png"
                    title: "放样传靶"
                    onReleased: {
                        if(fycb===0){
                            CMaintenance.maintenanceAction("热室端送靶打开")
                            fycb=1
                            CAnimationShifting.openBlowTarget()
                        }else{
                            CMaintenance.maintenanceAction("热室端送靶关闭")
                            fycb=0
                            CAnimationShifting.closeBlowTarget()
                        }
                    }
                }
            }
            Rectangle{
                x:0*dp
                y:parent.height*0.2
                width: parent.width
                height: parent.height*0.8
                border.width: 1
                border.color: "#B8B7B5"
                color: "#E0E6E9"
                ShiftingCanvas{
                    anchors.centerIn: parent
                    width: parent.width
                    height: Math.min(parent.height*0.8, parent.width)
                    onVisibleChanged: {
                        if(visible){
                            startAnimation()
                        }else{
                            stopAnimation()
                        }
                    }
                }
                Text {
                    text: qsTr("示意图")
                    font.bold: true
                    font.pixelSize: config.fontsize + 3*dp
                }
            }
        }
    }

    // 主布局
    //    Rectangle{
    //        visible: false
    //        x:30*dp
    //        y:20*dp
    //        width: parent.width-2*x
    //        height: parent.height-2*x

    //        // 上边 ==========================================
    //        Item{
    //            id: layout_top
    //            height: 180*dp; width: parent.width
    //            CustomButton{
    //                width: 100*dp
    //                height: 100*dp
    //                y: 20*dp
    //                title: "恢复初始"
    //                icon_color: "#56BD6C"
    //                button_color: isHovered? "#d9d9d9":"#F2F2F2"
    //                iconDirect: 1
    //                button_icon:"qrc:/picture/bt_hfcs.png"
    //                icon_size:33*dp
    //                onReleased: {
    //                    qdhfcs.show()
    //                }
    //            }
    //            CustomButton{
    //                width: 100*dp
    //                height: 100*dp
    //                x: 130*dp
    //                y: 20*dp
    //                title: "复位"
    //                icon_color: "#FFA200"
    //                button_color: isHovered? "#d9d9d9":"#F2F2F2"
    //                iconDirect: 1
    //                button_icon:"qrc:/picture/bt_fw.png"
    //                icon_size:33*dp
    //                onReleased: {
    //                    qdfw.show()
    //                }
    //                CustomTooltip{
    //                    visible: parent.isHovered
    //                    text: "复位到电机原点"
    //                }
    //            }
    //            CustomButton{
    //                width: 100*dp
    //                height: 100*dp
    //                x: 260*dp
    //                y: 20*dp
    //                title: "下发"
    //                icon_color: "#1677FF"
    //                button_color: isHovered? "#d9d9d9":"#F2F2F2"
    //                iconDirect: 1
    //                button_icon:"qrc:/picture/phwh_xf.png"
    //                icon_size:33*dp
    //                onReleased: {
    //                    qdxf.show()
    //                }
    //            }
    //            CustomButton{
    //                width: 100*dp
    //                height: 100*dp
    //                x: 390*dp
    //                y: 20*dp
    //                title: "状态获取"
    //                icon_color: "#1677FF"
    //                button_color: isHovered? "#d9d9d9":"#F2F2F2"
    //                iconDirect: 1
    //                button_icon:"qrc:/picture/phwh_zthq.png"
    //                icon_size:33*dp
    //                onReleased: {
    //                    statepop.show()
    //                }
    //            }

    //            Rectangle{
    //                width: parent.width*0.38
    //                height: parent.height
    //                x: parent.width*0.62
    //                border.color: "#B8B7B5"
    //                color: "#E0E6E9"
    ////                Image {
    ////                    id: pic1
    ////                    source: "qrc:/picture/glfb.png"
    ////                    fillMode: Image.PreserveAspectFit
    ////                    width: parent.width
    ////                    height: parent.height
    ////                }
    //                ShiftingCanvas{
    //                    anchors.centerIn: parent
    //                    width: Math.min(parent.width, parent.height*1.4)
    //                    height: Math.min(parent.height, parent.width * 0.8)
    //                    onVisibleChanged: {
    //                        if(visible){
    //                            startAnimation()
    //                        }else{
    //                            stopAnimation()
    //                        }
    //                    }
    //                }
    //                //                Rectangle{
    //                //                    x:20*dp
    //                //                    y:10*dp
    //                //                    Text {
    //                //                        text: qsTr("示意图")
    //                //                        font.bold: true
    //                //                        font.pixelSize: config.fontsize + 3*dp
    //                //                    }
    //                //                }
    //            }
    //        }
    //        // 下边
    //        Rectangle{
    //            id: layout_buttom
    //            y: layout_top.height + 10*dp
    //            width: parent.width
    //            height: parent.height - y
    //            radius: 10*dp
    //            border.color: "#B8B7B5"

    //            // 左半场
    //            ScrollView{
    //                y:10*dp
    //                id: scrollView
    //                width: parent.width*0.66
    //                height: parent.height-20*dp
    //                clip: true

    //                Column{
    //                    id: columnLayout
    //                    x:10*dp
    //                    y:40*dp
    //                    width: parent.width - 20*dp
    //                    height: parent.height-40*dp
    //                    Rectangle{
    //                        x:20*dp
    //                        radius: 8
    //                        border.color: "#DEDEDE"  // 边框颜色
    //                        border.width: 1
    //                        //                        y:150*dp
    //                        width:  scrollView.width-40*dp
    //                        height: 60*dp
    //                        Text {
    //                            x:20*dp
    //                            text: qsTr("维护")
    //                            font.bold: true
    //                            font.pixelSize: 20
    //                            anchors.verticalCenter: parent.verticalCenter
    //                        }
    //                        PushButton{
    //                            x:scrollView.width-120*dp
    //                            y:1*dp
    //                            width: 36*dp
    //                            height: 28*dp
    //                            icon_height: 28*dp
    //                            icon_width: 36*dp
    //                            anchors.verticalCenter: parent.verticalCenter
    //                            button_icon:{
    //                                if(isHover){
    //                                    return "qrc:/picture/ygd.png"
    //                                }else{
    //                                    if(gdwh===0){
    //                                        return "qrc:/picture/wgd.png"
    //                                    }else{
    //                                        "qrc:/picture/ygd.png"
    //                                    }
    //                                }
    //                            }
    //                            onReleased: {
    //                                if(gdwh===0){
    //                                    gdwh=1
    //                                }else{
    //                                    gdwh=0
    //                                }
    //                            }
    //                            CustomTooltip{
    //                                visible: parent.isHover
    //                                text: "固定"
    //                            }
    //                        }
    //                        PushButton{
    //                            x:scrollView.width-80*dp
    //                            y:1*dp
    //                            width: 36*dp
    //                            height: 28*dp
    //                            icon_height: 28*dp
    //                            icon_width: 36*dp
    //                            anchors.verticalCenter: parent.verticalCenter
    //                            button_icon:flagwh===1?"qrc:/picture/xs.png":"qrc:/picture/xx.png"
    //                            onReleased: {
    //                                if(flagwh===1){
    //                                    if(gdwh===1){
    //                                        return
    //                                    }
    //                                    flagwh=0
    //                                }else{
    //                                    flagwh=1
    //                                    if(gdcs===0){
    //                                        flagcs=0
    //                                    }
    //                                    if(gdwc===0){
    //                                        flagwc=0
    //                                    }
    //                                }
    //                            }
    //                        }
    //                    }
    //                    Rectangle{
    //                        visible: flagwh===1
    //                        x:20*dp
    //                        //                        y:200*dp
    //                        width: scrollView.width-40*dp
    //                        height: 120*dp
    //                        color: "#F9F9F9"
    //                        CustomDoubleButton{
    //                            title: "挡板运动"
    //                            name1: "遮挡"
    //                            name2: "打开"
    //                            x:20*dp
    //                            y:20*dp
    //                            width: (parent.width-120*dp)/5
    //                            onBt1: {
    //                                CMaintenance.maintenanceAction(title+name1)
    //                                CAnimationShifting.pushBaffle()
    //                            }
    //                            onBt2: {
    //                                CMaintenance.maintenanceAction(title+name2)
    //                                CAnimationShifting.pullBaffle()
    //                            }
    //                        }
    //                        CustomDoubleButton{
    //                            title: "热室端送靶"
    //                            name1: "打开"
    //                            name2: "关闭"
    //                            x:(parent.width-120*dp)/5+40*dp
    //                            y:20*dp
    //                            width: (parent.width-120*dp)/5
    //                            onBt1: {
    //                                CMaintenance.maintenanceAction(title+name1)
    //                                CAnimationShifting.openBlowTarget()
    //                            }
    //                            onBt2: {
    //                                CMaintenance.maintenanceAction(title+name2)
    //                                CAnimationShifting.closeBlowTarget()
    //                            }
    //                        }
    //                    }
    //                    Rectangle{
    //                        height: 10*dp
    //                        width: parent.width
    //                        x:0*dp
    //                    }
    //                    Rectangle{
    //                        x:20*dp
    //                        //                        y:150*dp
    //                        width:  scrollView.width-40*dp
    //                        height: 60*dp
    //                        radius: 8
    //                        border.color: "#DEDEDE"  // 边框颜色
    //                        border.width: 1
    //                        Text {
    //                            x:20*dp
    //                            text: qsTr("参数校正")
    //                            font.bold: true
    //                            font.pixelSize: 20
    //                            anchors.verticalCenter: parent.verticalCenter
    //                        }
    //                        PushButton{
    //                            x:scrollView.width-120*dp
    //                            y:1*dp
    //                            width: 36*dp
    //                            height: 28*dp
    //                            icon_height: 28*dp
    //                            icon_width: 36*dp
    //                            anchors.verticalCenter: parent.verticalCenter
    //                            button_icon:{
    //                                if(isHover){
    //                                    return "qrc:/picture/ygd.png"
    //                                }else{
    //                                    if(gdcs===0){
    //                                        return "qrc:/picture/wgd.png"
    //                                    }else{
    //                                        "qrc:/picture/ygd.png"
    //                                    }
    //                                    //                                    gddb===0?"qrc:/picture/wgd.png":"qrc:/picture/ygd.png"
    //                                }
    //                            }
    //                            onReleased: {
    //                                if(gdcs===0){
    //                                    gdcs=1
    //                                }else{
    //                                    gdcs=0
    //                                }
    //                            }
    //                            CustomTooltip{
    //                                visible: parent.isHover
    //                                text: "固定"
    //                            }
    //                        }
    //                        PushButton{
    //                            x:scrollView.width-80*dp
    //                            y:1*dp
    //                            width: 36*dp
    //                            height: 28*dp
    //                            icon_height: 28*dp
    //                            icon_width: 36*dp
    //                            anchors.verticalCenter: parent.verticalCenter
    //                            button_icon:flagcs===1?"qrc:/picture/xs.png":"qrc:/picture/xx.png"
    //                            onReleased: {
    //                                if(flagcs===1){
    //                                    if(gdcs===1){
    //                                        return
    //                                    }
    //                                    flagcs=0
    //                                }else{
    //                                    flagcs=1
    //                                    if(gdwh===0){
    //                                        flagwh=0
    //                                    }
    //                                    if(gdwc===0){
    //                                        flagwc=0
    //                                    }
    //                                }
    //                            }
    //                        }
    //                    }
    //                    Rectangle{
    //                        visible: flagcs===1
    //                        x:20*dp
    //                        color: "#F9F9F9"
    //                        //                        y:200*dp
    //                        width: scrollView.width-40*dp
    //                        height: 80*dp
    //                        CustomComboBox{
    //                            id:kgtype
    //                            x:20*dp
    //                            y:20*dp
    //                            editWidth: 120*dp
    //                            model: ["开阀门","关阀门","回靶关挡板"]
    //                        }
    //                        CustomInputText{
    //                            id:kgvalue
    //                            x:180*dp
    //                            y:20*dp
    //                            title: "空压机压力值"
    //                            titleWidth: 100*dp
    //                            editWidth: 80*dp
    //                        }
    //                        CustomButton{
    //                            x:parent.width-220*dp
    //                            y:20*dp
    //                            width: 100*dp
    //                            defaultMode1: true
    //                            title: "读取"
    //                            onReleased: {
    //                                CMaintenance.getAir(kgtype.getText())
    //                            }
    //                        }
    //                        CustomButton{
    //                            x:parent.width-110*dp
    //                            y:20*dp
    //                            width: 100*dp
    //                            defaultMode1: true
    //                            title: "写入"
    //                            onReleased: {
    //                                CMaintenance.setAir(kgtype.getText(),kgvalue.getText())
    //                            }
    //                        }
    //                    }
    //                    Rectangle{
    //                        height: 10*dp
    //                        width: parent.width
    //                        x:0*dp
    //                    }
    //                    Rectangle{
    //                        x:20*dp
    //                        //                        y:150*dp
    //                        width:  scrollView.width-40*dp
    //                        height: 60*dp
    //                        radius: 8
    //                        border.color: "#DEDEDE"  // 边框颜色
    //                        border.width: 1
    //                        Text {
    //                            x:20*dp
    //                            text: qsTr("无参校正")
    //                            font.bold: true
    //                            font.pixelSize: 20
    //                            anchors.verticalCenter: parent.verticalCenter
    //                        }
    //                        PushButton{
    //                            x:scrollView.width-120*dp
    //                            y:1*dp
    //                            width: 36*dp
    //                            height: 28*dp
    //                            icon_height: 28*dp
    //                            icon_width: 36*dp
    //                            anchors.verticalCenter: parent.verticalCenter
    //                            button_icon:{
    //                                if(isHover){
    //                                    return "qrc:/picture/ygd.png"
    //                                }else{
    //                                    if(gdwc===0){
    //                                        return "qrc:/picture/wgd.png"
    //                                    }else{
    //                                        "qrc:/picture/ygd.png"
    //                                    }
    //                                    //                                    gddb===0?"qrc:/picture/wgd.png":"qrc:/picture/ygd.png"
    //                                }
    //                            }
    //                            onReleased: {
    //                                if(gdwc===0){
    //                                    gdwc=1
    //                                }else{
    //                                    gdwc=0
    //                                }
    //                            }
    //                            CustomTooltip{
    //                                visible: parent.isHover
    //                                text: "固定"
    //                            }
    //                        }
    //                        PushButton{
    //                            x:scrollView.width-80*dp
    //                            y:1*dp
    //                            width: 36*dp
    //                            height: 28*dp
    //                            icon_height: 28*dp
    //                            icon_width: 36*dp
    //                            anchors.verticalCenter: parent.verticalCenter
    //                            button_icon:flagwc===1?"qrc:/picture/xs.png":"qrc:/picture/xx.png"
    //                            onReleased: {
    //                                if(flagwc===1){
    //                                    if(gdwc===1){
    //                                        return
    //                                    }
    //                                    flagwc=0
    //                                }else{
    //                                    flagwc=1
    //                                    if(gdwh===0){
    //                                        flagwh=0
    //                                    }
    //                                    if(gdcs===0){
    //                                        flagcs=0
    //                                    }
    //                                }
    //                            }
    //                        }
    //                    }
    //                    Rectangle{
    //                        visible: flagwc===1
    //                        x:20*dp
    //                        color: "#F9F9F9"
    //                        //                        y:200*dp
    //                        width: scrollView.width-40*dp
    //                        height: 80*dp
    //                        Rectangle{
    //                            x:0*dp
    //                            y:20*dp
    //                            width: parent.width
    //                            height: 40*dp
    //                            color: "transparent"
    //                            CustomInputText{
    //                                id:fbqdyl
    //                                title: "气道压力"
    //                                x:10*dp
    //                                titleWidth: 100*dp
    //                                editWidth: 120*dp
    //                            }
    //                        }
    //                    }

    //                    Rectangle{
    //                        x:0*dp
    //                        //                        y:50*dp
    //                        width: scrollView.width
    //                        height: 40*dp
    //                    }
    //                }
    //            }

    //            Rectangle{ // 中间的竖线
    //                x: parent.width*0.67
    //                width: 1*dp
    //                height: parent.height
    //                color: "#B8B7B5"
    //            }
    //            // 右半场
    //            Item{
    //                x: parent.width * 0.68
    //                width: parent.width * 0.31
    //                height: parent.height
    //                Rectangle{
    //                    y:20*dp; x: 20*dp
    //                    Text {
    //                        text: qsTr("通信日志")
    //                        font.bold: true
    //                        font.pixelSize: config.fontsize + 3*dp
    //                    }
    //                }
    //                PushButton{
    //                    x:parent.width-140*dp
    //                    y:20*dp
    //                    button_icon: "qrc:/picture/br_qc.png"
    //                    title: "清除"
    //                    width: 60*dp
    //                    text_color: "#1677FF"
    //                    icon_height: 20*dp
    //                    icon_width: 20*dp
    //                    onReleased: {
    //                        CMaintenance.delLog()
    //                    }
    //                }
    //                PushButton{
    //                    x:parent.width-70*dp
    //                    y:20*dp
    //                    button_icon: "qrc:/picture/bt_dc.png"
    //                    title: "导出"
    //                    width: 60*dp
    //                    text_color: "#1677FF"
    //                    icon_height: 20*dp
    //                    icon_width: 20*dp
    //                    onReleased: {
    //                        CMaintenance.exportLog()
    //                    }
    //                }
    //                Rectangle{
    //                    x: 20*dp
    //                    y:65*dp
    //                    color: "#B8B7B5"
    //                    width: parent.width-2*x
    //                    height: parent.height-70*dp
    //                    DataLog{
    //                        id:logtab
    //                    }
    //                }
    //            }
    //        }
    //    }


    Toast{
        id: maintenanceToast
        x: (parent.width-width) * 0.5
        y: 100*dp
    }

}
